package com.wgchao.identityrightsmanagement.infrastructure.jpa.repository;

import com.wgchao.identityrightsmanagement.infrastructure.jpa.entity.SysResourceMenu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName: SysResourceMenuRepository
 * @author: wgchao
 * @createTime: 2020/6/18 10:34 AM
 * @Description: TODO
 */
@Repository
public interface SysResourceMenuRepository extends JpaRepository<SysResourceMenu, Long> {
    SysResourceMenu findFirstByMenuMark(String menuMark);
    List<SysResourceMenu> findAllByProMark(String proMark);
    //查询项目下顶级菜单
    List<SysResourceMenu> findAllByProMarkAndSuperiorMarkIsNull(String proMark);
    //  查询下一级菜单
    List<SysResourceMenu> findAllByProMarkAndSuperiorMark(String proMark, String superiorMark);
}
